USE [WSS_Content_80]
GO
/****** Object:  StoredProcedure [dbo].[proc_WebUrlList]    Script Date: 04/01/2011 12:45:43 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
Create PROCEDURE [dbo].[proc_WebUrlList]
   @UserName                     nvarchar(255) 
AS
   Begin
    select W.Title,W.FullUrl,W.TimeCreated,W.Description
    ,(Select top 1 USF.tp_Title From UserInfo USF where USF.tp_SiteAdmin=1 and UF.tp_SiteID = USF.tp_SiteID order by USF.tp_SiteID)
    as tp_Title
    from Webs W,UserInfo UF
    where 
    (UF.tp_Login=@UserName or UF.tp_Login='i:0#.f|sqlmember|'+@UserName) 
    and W.FullUrl!='' and W.FullUrl like '%/%'
     AND UF.tp_SiteID = W.SiteId and W.TemplateVersion!='3' and UF.tp_Token is not null
    and W.SiteId not in 
    (Select SD.SiteId from SiteDeletion SD) 

 End
